<template>
	<view class="mainpadding" v-if="pageShow">
		<view class="mainpadding ffffff shadow radius flextop">
			<image style="width: 230rpx;height: 170rpx;" :src="dataAll.carshopgoodsinfo.image_text" mode=""></image>
			<view class="flexcolumnbet" style="width: 60%;height: 170rpx;">
				<view class="titletext zhonghei fonweight xiankuan">{{dataAll.carshopgoodsinfo.name}}</view>
				<view class="">
					<text class="strongtext xiaohong">￥</text>
					<text class="bigtext xiaohong fonweight">{{dataAll.carshopgoodsinfo.price}}</text>
				</view>
			</view>
		</view>
		<view class="gudingdb mainpadding" @click="tzzf">
			<view class="bigbtny">确定</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				listid:"",
				dataAll:{},
				pageShow:false
			}
		},
		onLoad(options) {
			this.listid = options.id
			this.getdingdan()
		},
		methods: {
			getdingdan() {
				httpRequest.request("/api/Carshopordercl/getOrderSure", 'GET', {
					carshop_goods_id:this.listid
				}, false, false, true).then(res => {
					if (res.code == 1) {
						this.dataAll = res.data
						this.pageShow = true
					}
				})
			},
			// 跳转支付
			tzzf(){
				httpRequest.request('/api/Carshopordercl/addOrder', 'GET', {
					carshop_goods_id: this.listid,
					carshop_id:this.dataAll.carshopgoodsinfo.carshop_ids
				}, false, false, true).then(res => {
					let data = {
						order_id:res.data.order_id,
						pay_price:res.data.pay_price,
						pay_score:this.dataAll.score,
						type:3
					}
					uni.redirectTo({
						url: '/pages_index/zhifuTwo?msg='+encodeURIComponent(JSON.stringify(data))
					})
				})
				
			}
		}
	}
</script>

<style lang="scss" scoped>
	.inputs {
		border-radius: 12rpx 12rpx 12rpx 12rpx;
		border: 2rpx solid #E8E8E8;
		padding: 25rpx 30rpx;
		background: #F2F2F2;
	}
</style>